package Wires.diagram.part;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.gef.Tool;
import org.eclipse.gef.palette.PaletteContainer;
import org.eclipse.gef.palette.PaletteDrawer;
import org.eclipse.gef.palette.PaletteGroup;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.palette.PaletteSeparator;
import org.eclipse.gef.palette.ToolEntry;
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeConnectionTool;
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCreationTool;

/**
 * @generated
 */
public class WiresPaletteFactory {

	/**
	 * @generated
	 */
	public void fillPalette(PaletteRoot paletteRoot) {
		paletteRoot.add(createWires1Group());
	}

	/**
	 * Creates "Wires" palette tool group
	 * @generated
	 */
	private PaletteContainer createWires1Group() {
		PaletteGroup paletteContainer = new PaletteGroup(
				Wires.diagram.part.Messages.Wires1Group_title);
		paletteContainer.add(createElements1Group());
		paletteContainer.add(createTypes2Group());
		return paletteContainer;
	}

	/**
	 * Creates "Elements" palette tool group
	 * @generated
	 */
	private PaletteContainer createElements1Group() {
		PaletteDrawer paletteContainer = new PaletteDrawer(
				Wires.diagram.part.Messages.Elements1Group_title);
		paletteContainer
				.setDescription(Wires.diagram.part.Messages.Elements1Group_desc);
		paletteContainer.add(createModel1CreationTool());
		paletteContainer.add(createBasicData2CreationTool());
		paletteContainer.add(new PaletteSeparator());
		paletteContainer.add(createQuery4CreationTool());
		paletteContainer.add(createAtomicModelTransf5CreationTool());
		paletteContainer.add(createIdentityTransf6CreationTool());
		paletteContainer.add(createGenericTransf7CreationTool());
		paletteContainer.add(createCompositeTransf8CreationTool());
		paletteContainer.add(createModel2TextTransf9CreationTool());
		paletteContainer.add(new PaletteSeparator());
		paletteContainer.add(createInputActualParam11CreationTool());
		paletteContainer.add(createOutputActualParam12CreationTool());
		paletteContainer.add(createTypeParam13CreationTool());
		paletteContainer.add(new PaletteSeparator());
		paletteContainer.add(createDataFlow15CreationTool());
		paletteContainer.add(new PaletteSeparator());
		paletteContainer.add(createDecisionNode17CreationTool());
		paletteContainer.add(createTrueBranch18CreationTool());
		paletteContainer.add(createFalseBranch19CreationTool());
		return paletteContainer;
	}

	/**
	 * Creates "Types" palette tool group
	 * @generated
	 */
	private PaletteContainer createTypes2Group() {
		PaletteDrawer paletteContainer = new PaletteDrawer(
				Wires.diagram.part.Messages.Types2Group_title);
		paletteContainer
				.setDescription(Wires.diagram.part.Messages.Types2Group_desc);
		paletteContainer.add(createModelType1CreationTool());
		paletteContainer.add(createLibrary2CreationTool());
		paletteContainer.add(new PaletteSeparator());
		paletteContainer.add(createQueryType4CreationTool());
		paletteContainer.add(createAtomicModelTransfType5CreationTool());
		paletteContainer.add(createCompositeTransfType6CreationTool());
		paletteContainer.add(createModel2TextTransfType7CreationTool());
		paletteContainer.add(new PaletteSeparator());
		paletteContainer.add(createInputFormalParam9CreationTool());
		paletteContainer.add(createOutputFormalParam10CreationTool());
		paletteContainer.add(createLibraryRef11CreationTool());
		return paletteContainer;
	}

	/**
	 * @generated
	 */
	private ToolEntry createModel1CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types.add(Wires.diagram.providers.WiresElementTypes.Model_1008);
		types.add(Wires.diagram.providers.WiresElementTypes.Model_2009);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.Model1CreationTool_title,
				Wires.diagram.part.Messages.Model1CreationTool_desc, types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.Model_1008));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createBasicData2CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types.add(Wires.diagram.providers.WiresElementTypes.BasicData_1007);
		types.add(Wires.diagram.providers.WiresElementTypes.BasicData_2010);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.BasicData2CreationTool_title,
				Wires.diagram.part.Messages.BasicData2CreationTool_desc, types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.BasicData_1007));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createQuery4CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types.add(Wires.diagram.providers.WiresElementTypes.Query_1006);
		types.add(Wires.diagram.providers.WiresElementTypes.Query_2015);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.Query4CreationTool_title,
				Wires.diagram.part.Messages.Query4CreationTool_desc, types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.Query_1006));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createAtomicModelTransf5CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types
				.add(Wires.diagram.providers.WiresElementTypes.AtomicModelTransformation_1001);
		types
				.add(Wires.diagram.providers.WiresElementTypes.AtomicModelTransformation_2012);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.AtomicModelTransf5CreationTool_title,
				Wires.diagram.part.Messages.AtomicModelTransf5CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.AtomicModelTransformation_1001));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createIdentityTransf6CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types
				.add(Wires.diagram.providers.WiresElementTypes.IdentityTransformation_1002);
		types
				.add(Wires.diagram.providers.WiresElementTypes.IdentityTransformation_2014);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.IdentityTransf6CreationTool_title,
				Wires.diagram.part.Messages.IdentityTransf6CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.IdentityTransformation_1002));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createGenericTransf7CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types
				.add(Wires.diagram.providers.WiresElementTypes.GenericTransformation_1003);
		types
				.add(Wires.diagram.providers.WiresElementTypes.GenericTransformation_2013);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.GenericTransf7CreationTool_title,
				Wires.diagram.part.Messages.GenericTransf7CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.GenericTransformation_1003));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createCompositeTransf8CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types
				.add(Wires.diagram.providers.WiresElementTypes.CompositeTransformation_1004);
		types
				.add(Wires.diagram.providers.WiresElementTypes.CompositeTransformation_2011);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.CompositeTransf8CreationTool_title,
				Wires.diagram.part.Messages.CompositeTransf8CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.CompositeTransformation_1004));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createModel2TextTransf9CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types
				.add(Wires.diagram.providers.WiresElementTypes.Model2TextTransformation_1005);
		types
				.add(Wires.diagram.providers.WiresElementTypes.Model2TextTransformation_2017);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.Model2TextTransf9CreationTool_title,
				Wires.diagram.part.Messages.Model2TextTransf9CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.Model2TextTransformation_1005));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createInputActualParam11CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types
				.add(Wires.diagram.providers.WiresElementTypes.InputActualParameter_2001);
		types
				.add(Wires.diagram.providers.WiresElementTypes.InputActualParameter_2004);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.InputActualParam11CreationTool_title,
				Wires.diagram.part.Messages.InputActualParam11CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.InputActualParameter_2001));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createOutputActualParam12CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types
				.add(Wires.diagram.providers.WiresElementTypes.OutputActualParameter_2002);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.OutputActualParam12CreationTool_title,
				Wires.diagram.part.Messages.OutputActualParam12CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.OutputActualParameter_2002));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createTypeParam13CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types.add(Wires.diagram.providers.WiresElementTypes.TypeParameter_2003);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.TypeParam13CreationTool_title,
				Wires.diagram.part.Messages.TypeParam13CreationTool_desc, types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.TypeParameter_2003));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createDataFlow15CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types.add(Wires.diagram.providers.WiresElementTypes.DataFlow_3001);
		LinkToolEntry entry = new LinkToolEntry(
				Wires.diagram.part.Messages.DataFlow15CreationTool_title,
				Wires.diagram.part.Messages.DataFlow15CreationTool_desc, types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.DataFlow_3001));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createDecisionNode17CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types.add(Wires.diagram.providers.WiresElementTypes.DecisionNode_1010);
		types.add(Wires.diagram.providers.WiresElementTypes.DecisionNode_2016);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.DecisionNode17CreationTool_title,
				Wires.diagram.part.Messages.DecisionNode17CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.DecisionNode_1010));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createTrueBranch18CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types
				.add(Wires.diagram.providers.WiresElementTypes.DecisionNodeTrueBranch_3002);
		LinkToolEntry entry = new LinkToolEntry(
				Wires.diagram.part.Messages.TrueBranch18CreationTool_title,
				Wires.diagram.part.Messages.TrueBranch18CreationTool_desc,
				types);
		entry.setSmallIcon(Wires.diagram.part.WiresDiagramEditorPlugin
				.findImageDescriptor("/Wires.diagram/icons/TrueBranch.gif")); //$NON-NLS-1$
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createFalseBranch19CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types
				.add(Wires.diagram.providers.WiresElementTypes.DecisionNodeFalseBranch_3003);
		LinkToolEntry entry = new LinkToolEntry(
				Wires.diagram.part.Messages.FalseBranch19CreationTool_title,
				Wires.diagram.part.Messages.FalseBranch19CreationTool_desc,
				types);
		entry.setSmallIcon(Wires.diagram.part.WiresDiagramEditorPlugin
				.findImageDescriptor("/Wires.diagram/icons/FalseBranch.gif")); //$NON-NLS-1$
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createModelType1CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types.add(Wires.diagram.providers.WiresElementTypes.ModelType_1009);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.ModelType1CreationTool_title,
				Wires.diagram.part.Messages.ModelType1CreationTool_desc, types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.ModelType_1009));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createLibrary2CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types.add(Wires.diagram.providers.WiresElementTypes.Library_1011);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.Library2CreationTool_title,
				Wires.diagram.part.Messages.Library2CreationTool_desc, types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.Library_1011));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createQueryType4CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types.add(Wires.diagram.providers.WiresElementTypes.QueryType_1014);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.QueryType4CreationTool_title,
				Wires.diagram.part.Messages.QueryType4CreationTool_desc, types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.QueryType_1014));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createAtomicModelTransfType5CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types
				.add(Wires.diagram.providers.WiresElementTypes.AtomicModelTransfomationType_1012);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.AtomicModelTransfType5CreationTool_title,
				Wires.diagram.part.Messages.AtomicModelTransfType5CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.AtomicModelTransfomationType_1012));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createCompositeTransfType6CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types
				.add(Wires.diagram.providers.WiresElementTypes.CompositeTransformationType_1015);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.CompositeTransfType6CreationTool_title,
				Wires.diagram.part.Messages.CompositeTransfType6CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.CompositeTransformationType_1015));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createModel2TextTransfType7CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types
				.add(Wires.diagram.providers.WiresElementTypes.Model2TextTransformationType_1013);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.Model2TextTransfType7CreationTool_title,
				Wires.diagram.part.Messages.Model2TextTransfType7CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.Model2TextTransformationType_1013));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createInputFormalParam9CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types
				.add(Wires.diagram.providers.WiresElementTypes.InputFormalParameter_2006);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.InputFormalParam9CreationTool_title,
				Wires.diagram.part.Messages.InputFormalParam9CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.InputFormalParameter_2006));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createOutputFormalParam10CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1);
		types
				.add(Wires.diagram.providers.WiresElementTypes.OutputFormalParameter_2007);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.OutputFormalParam10CreationTool_title,
				Wires.diagram.part.Messages.OutputFormalParam10CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.OutputFormalParameter_2007));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createLibraryRef11CreationTool() {
		List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2);
		types.add(Wires.diagram.providers.WiresElementTypes.LibraryRef_2005);
		types.add(Wires.diagram.providers.WiresElementTypes.LibraryRef_2008);
		NodeToolEntry entry = new NodeToolEntry(
				Wires.diagram.part.Messages.LibraryRef11CreationTool_title,
				Wires.diagram.part.Messages.LibraryRef11CreationTool_desc,
				types);
		entry
				.setSmallIcon(Wires.diagram.providers.WiresElementTypes
						.getImageDescriptor(Wires.diagram.providers.WiresElementTypes.LibraryRef_2005));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private static class NodeToolEntry extends ToolEntry {

		/**
		 * @generated
		 */
		private final List elementTypes;

		/**
		 * @generated
		 */
		private NodeToolEntry(String title, String description,
				List elementTypes) {
			super(title, description, null, null);
			this.elementTypes = elementTypes;
		}

		/**
		 * @generated
		 */
		public Tool createTool() {
			Tool tool = new UnspecifiedTypeCreationTool(elementTypes);
			tool.setProperties(getToolProperties());
			return tool;
		}
	}

	/**
	 * @generated
	 */
	private static class LinkToolEntry extends ToolEntry {

		/**
		 * @generated
		 */
		private final List relationshipTypes;

		/**
		 * @generated
		 */
		private LinkToolEntry(String title, String description,
				List relationshipTypes) {
			super(title, description, null, null);
			this.relationshipTypes = relationshipTypes;
		}

		/**
		 * @generated
		 */
		public Tool createTool() {
			Tool tool = new UnspecifiedTypeConnectionTool(relationshipTypes);
			tool.setProperties(getToolProperties());
			return tool;
		}
	}
}
